package com.banyuan.ClassRelated.practice;

public class Human1 {
    private String name;
    private String job;
    private int money;

    public Human1(String name, String job, int money) {
        this.name = name;
        this.job = job;
        this.money = money;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setJob(String job) {
        this.job = job;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public String getName() {
        return name;
    }

    public String getJob() {
        return job;
    }

    public int getMoney() {
        return money;
    }

    public void rob(Human1 h1) {
        this.money += 10;
        h1.setMoney(h1.getMoney() - 10);
        System.out.println(this.job + this.name + "抢劫了" + h1.getJob() + h1.getName() + "10块钱");
        System.out.println(this.job + this.name + "现在拥有" + this.money + "块钱");
        System.out.println(h1.getJob() + h1.getName() + "还剩" + h1.getMoney() + "块钱");
    }
}
